package xinyou.jh.net.heartLaw
{
	import xinyou.jh.net.JHReceiver;
	import xinyou.net.SocketConnection;
	
	/**
	 * 
	 * @author shanxiao
	 * 接收到心法相关的socket信息
	 * 
	 */
	public class HeartLawReceiver extends JHReceiver
	{
		public function HeartLawReceiver(socket:SocketConnection)
		{
			super(socket);
		}
		
		override protected function initCallBack():void
		{
			addCallBack([135,16],getXfList);
			addCallBack([135,0],getXfError);
			addCallBack([135,6],getUpXinFa);
			addCallBack([135,2],getXueXinFa);
			addCallBack([135,8],getDownXinFa);
			addCallBack([135,4],getLvUpXinFa);
			addCallBack([135,10],xueWG);
			addCallBack([135,12],upWG);
			addCallBack([135,14],downWG);
			addCallBack([135,18],getXinfaInfo);
		}
		
		/**获取学习心法通知*/
		public function getXueXinFa(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.XUEXINFA,result));
		}
		
		/**获取心法列表后*/
		public function getXfList(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.XFLIST,result));
		}
		
		/**获取心法错误信息后*/
		public function getXfError(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.XFERROR,result));
		}
		
		/**获取装备心法的返回结果*/
		public function getUpXinFa(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.GETUPXF,result));
		}
		
		/**获取卸载心法的返回结果*/
		public function getDownXinFa(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.DOWNXF,result));
		}
		
		/**获取升级心法的返回结果*/
		public function getLvUpXinFa(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.LVUP,result));
		}
		/**学习武功*/
		public function xueWG(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.XUEWG,result));
		}
		/**装备武功*/
		public function upWG(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.UPWG,result));
		}
		/**卸载武功*/
		public function downWG(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.DOWNWG,result));
		}
		/**获取每个心法的武功信息*/
		public function getXinfaInfo(result:Object):void
		{
			dispatchEvent(new HeartLawEvent(HeartLawEvent.GETXINFAXINFO,result));
		}
	}
}